<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<html><head>
<!--Converted with LaTeX2HTML 98.1 release (February 19th, 1998)
originally by Nikos Drakos (nikos@cbl.leeds.ac.uk), CBLU, University of Leeds
* revised and updated by:  Marcus Hennecke, Ross Moore, Herb Swan
* with significant contributions from:
  Jens Lippmann, Marek Rouchal, Martin Wilck and others -->


<title>Goldbach's Conjecture</title>
<meta name="description" content="Goldbach's Conjecture">
<meta name="keywords" content="htmlatex">
<meta name="resource-type" content="document">
<meta name="distribution" content="global">
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<link rel="STYLESHEET" href="acm-00543_archivos/htmlatex.css">
</head><body bgcolor="#ffffff" lang="EN">

<h1><br clear="ALL"><center><table bgcolor="#0060f0"><tbody><tr><td><b><font color="#c0ffff" size="5">&nbsp;<a name="SECTION0001000000000000000000">
Goldbach's Conjecture</a>&nbsp;</font></b></td></tr></tbody></table></center>
</h1>

<p>
In 1742, Christian Goldbach, a German amateur mathematician, sent a letter to Leonhard Euler in
which he made the following conjecture:
</p><p><i>Every number greater than 2 can be written as the sum of three prime numbers.</i>

</p><p>Goldbach cwas considering 1 as a primer number, a convention
that is no longer followed. Later on, Euler re-expressed the conjecture
as:
</p><p><i>Every even number greater than or equal to 4 can be expressed as the sum of two prime numbers.</i>

</p><p>

</p><p>
<br>
For example:

</p><p>
</p><ul>
<li>8 = 3 + 5. Both 3 and 5 are odd prime numbers.
</li><li>20 = 3 + 17 = 7 + 13.
</li><li>42 = 5 + 37 = 11 + 31 = 13 + 29 = 19 + 23.
</li></ul>

<p>
Today it is still unproven whether the conjecture is right. (Oh wait, I have the proof of course, but it
is too long to write it on the margin of this page.)

</p><p>

</p><p>
<br>
Anyway, your task is now to verify Goldbach's conjecture as expressed by Euler for all even numbers less than a million.

</p><p>

</p><h2><font color="#0070e8"><a name="SECTION0001001000000000000000">
Input</a>&nbsp;</font>
</h2>
The input file will contain one or more test cases.

<p>
Each test case consists of one even integer <i>n</i> with 
<!-- MATH: $6 \le n < 1000000$ -->
<img src="acm-00543_archivos/543img2.gif" alt="$6 \le n &lt; 1000000$" align="MIDDLE" border="0" height="30" width="131">.

</p><p>
Input will be terminated by a value of 0 for <i>n</i>.

</p><p>

</p><h2><font color="#0070e8"><a name="SECTION0001002000000000000000">
Output</a>&nbsp;</font>
</h2>
For each test case, print one line of the form <i>n</i> = <i>a</i> + <i>b</i>, where <i>a</i> and <i>b</i> are odd primes. Numbers and
operators should be separated by exactly one blank like in the sample output below. If there is more
than one pair of odd primes adding up to <i>n</i>, choose the pair where the difference <i>b</i> - <i>a</i> is maximized.

<p>
If there is no such pair, print a line saying ``<tt>Goldbach's conjecture is wrong.</tt>"

</p><p>

</p><h2><font color="#0070e8"><a name="SECTION0001003000000000000000">
Sample Input</a>&nbsp;</font>
</h2>

<p>
</p><pre>8
20
42
0
</pre>

<p>

</p><h2><font color="#0070e8"><a name="SECTION0001004000000000000000">
Sample Output</a>&nbsp;</font>
</h2>

<p>
</p><pre>8 = 3 + 5
20 = 3 + 17
42 = 5 + 37
</pre>

<p>

</p><p>
<br></p><hr>
<address>
<i>Miguel A. Revilla</i>
<br><i>1999-01-11</i>
</address>
</body></html>